# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Run.V2.Model.GoogleCloudRunV2Volume do
  @moduledoc """
  Volume represents a named volume in a container.

  ## Attributes

  *   `cloudSqlInstance` (*type:* `GoogleApi.Run.V2.Model.GoogleCloudRunV2CloudSqlInstance.t`, *default:* `nil`) - For Cloud SQL volumes, contains the specific instances that should be mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run.
  *   `emptyDir` (*type:* `GoogleApi.Run.V2.Model.GoogleCloudRunV2EmptyDirVolumeSource.t`, *default:* `nil`) - Ephemeral storage used as a shared volume.
  *   `gcs` (*type:* `GoogleApi.Run.V2.Model.GoogleCloudRunV2GCSVolumeSource.t`, *default:* `nil`) - Persistent storage backed by a Google Cloud Storage bucket.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Volume's name.
  *   `nfs` (*type:* `GoogleApi.Run.V2.Model.GoogleCloudRunV2NFSVolumeSource.t`, *default:* `nil`) - For NFS Voumes, contains the path to the nfs Volume
  *   `secret` (*type:* `GoogleApi.Run.V2.Model.GoogleCloudRunV2SecretVolumeSource.t`, *default:* `nil`) - Secret represents a secret that should populate this volume.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudSqlInstance => GoogleApi.Run.V2.Model.GoogleCloudRunV2CloudSqlInstance.t() | nil,
          :emptyDir => GoogleApi.Run.V2.Model.GoogleCloudRunV2EmptyDirVolumeSource.t() | nil,
          :gcs => GoogleApi.Run.V2.Model.GoogleCloudRunV2GCSVolumeSource.t() | nil,
          :name => String.t() | nil,
          :nfs => GoogleApi.Run.V2.Model.GoogleCloudRunV2NFSVolumeSource.t() | nil,
          :secret => GoogleApi.Run.V2.Model.GoogleCloudRunV2SecretVolumeSource.t() | nil
        }

  field(:cloudSqlInstance, as: GoogleApi.Run.V2.Model.GoogleCloudRunV2CloudSqlInstance)
  field(:emptyDir, as: GoogleApi.Run.V2.Model.GoogleCloudRunV2EmptyDirVolumeSource)
  field(:gcs, as: GoogleApi.Run.V2.Model.GoogleCloudRunV2GCSVolumeSource)
  field(:name)
  field(:nfs, as: GoogleApi.Run.V2.Model.GoogleCloudRunV2NFSVolumeSource)
  field(:secret, as: GoogleApi.Run.V2.Model.GoogleCloudRunV2SecretVolumeSource)
end

defimpl Poison.Decoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2Volume do
  def decode(value, options) do
    GoogleApi.Run.V2.Model.GoogleCloudRunV2Volume.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2Volume do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
